<template>
  <div id="nav">
    <div id="navSide">
      <div class="txarea">
        <img src="@/assets/img/tx.jpg" alt="" class="tx" />
      </div>
      <div class="optionarea">
        <div class="optText" v-for="(ite,index) in xuanz" :key="(ite,index)" >
          <p class="contact" @click="routertiz(ite.push)">{{ ite.text }}</p>
          <p class="slide">></p>
        </div>
      </div>
    </div>
    <div class="navrou">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      xuanz : [{push:'/information',text:'联系方式'},{push:'/contact',text:'基本信息'},{push:'/development',text:'开发项目'}]
    }
  },
  methods: {
    routertiz(push){
      console.log(push);
      this.$router.push(push);
    },
  },
};
</script>

<style>
#nav {
  display: flex;
  width: 8rem;
  height: 120vh;
  overflow: auto;
  background-color: #f5f5f5;
  margin: 0 auto;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  box-shadow: 2px 5px 5px #888;
}
#navSide {
  width: 1rem;
  height: 120vh;
  padding: 0.25rem;
  overflow: auto;
  font-size: 0.2rem;
  background-image: linear-gradient(#9198e5,#e66465);
  /* background-image: linear-gradient(pink, #9198e5); */
  transition: 1s;
}
#navSide .tx {
  width: 90%;
}
#navSide .txarea {
  text-align: center;
  width: 100%;
}
#navSide:hover {
  width: 2.5rem;
}
#navSide .optText {
  width: 100%;
  display: flex;
  height: 0.3rem;
  overflow: hidden;
  color: rgb(255, 255, 255);
  text-align: center;
  margin-top: 0.2rem;
}
#navSide .slide {
  transition: 0.5s;
  margin-left: 0.1rem;
}
#navSide .optText:hover .slide {
  margin-left: 0.4rem;
}
.navrou {
  max-width: 7rem;
  width: 100%;
}
</style>